#pragma once
#include "public.h"
#include <stdio.h>
#include <vector>
#include <map>
class VirtualNDK;


class VMemory
{
public:
	VMemory(VirtualNDK* vndk);
	~VMemory();

private:
	VirtualNDK* vndk;
	uint64_t counter_memory;// = config.BASE_ADDR
	uint64_t counter_stack;// = config.STACK_ADDR + config.STACK_SIZE
public:
	uint64_t mem_reserve(int size);
	void mem_map(uint64_t address, size_t size, uint32_t prot);
	void mem_protect(uint64_t address, size_t size, uint32_t prot);
	void mem_write(uint64_t address, const void * bytes, size_t size);
	void mem_read(uint64_t address,  void * bytes, size_t size);
	void mem_set(uint64_t dst, int val, size_t size);
};

